Don't leak on replacement.
authorrobertl <robertl>
Thu, 6 Jan 2005 16:24:17 +0000 (16:24 +0000)
committerrobertl <robertl>
Thu, 6 Jan 2005 16:24:17 +0000 (16:24 +0000)
util.c

diff --git a/util.c b/util.c
index 11d3e878393754aefd63c992bd6149e7e6d106c1..69f0d9370b07a14293c80c3499d669d707e85fa7 100644 (file)
--- a/util.c
+++ b/util.c
@@ -658,7 +658,9 @@ gstrsub(const char *s, const char *search, const char *replace)
        char *o = xstrdup(s);
 
        while (strstr(o, search)) {
+               char *oo = o;
                o = strsub(o, search, replace);
+               xfree(oo);
        }
 
        return o;